<html>
<head>

</head>



<body>

<?php echo $_SERVER['REMOTE_ADDR'] . "<br/>";?>
<script>

window.onbeforeunload = function (my_event) {
	var message = "Your logout page has been opened in a new window, Check that out. Make sure that you have enabled pop up in your browser to see that?";
	if (typeof my_event == 'undefined') {
	my_event = window.event;
	}
	if (my_event) {
	newWindow=window.open('test.html','','width=450,height=350')
	newWindow.document.write("<p>This is 'newWindow'</p>")
	newWindow.focus();
	my_event.returnValue = message;
	}
	return message;
	}

</script>

<a href="arguquest.web.ua.pt">arguquest</a>

</body>

</html>


<?php 


session_start();
// set timeout period in seconds
$inactive = 600;
// check to see if $_SESSION['timeout'] is set
if(isset($_SESSION['timeout']) ) {
	$session_life = time() - $_SESSION['start'];
	if($session_life > $inactive)
	{
		session_destroy(); header("Location: logoutpage.php");
	}
}
$_SESSION['timeout'] = time();

?>